Declare Function SelectObject% Lib "GDI" (ByVal hDC%, ByVal hObject%)
Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Integer
'For Global memory
Declare Function GlobalAlloc Lib "Kernel" (ByVal wFlags As Integer, ByVal dwBytes As Long) As Integer
Declare Function GlobalHandleToSel Lib "Toolhelp.DLL" (ByVal Handle As Integer) As Integer
Declare Function GlobalFree Lib "Kernel" (ByVal hMem As Integer) As Integer
Declare Function MemoryRead Lib "Toolhelp.dll" (ByVal wSel As Integer, ByVal dwOffSet As Long, lpvBuf As Any, ByVal dwcb As Long) As Long
Declare Function MemoryWrite Lib "Toolhelp.dll" (ByVal wSel As Integer, ByVal dwOffSet As Long, lpvBuf As Any, ByVal dwcb As Long) As Long
Global Const GMEM_FIXED = &H0
Global Const ELEMENT_SIZE& = 77
' Key Codes
Global Const KEY_PRIOR = &H21
Global Const KEY_NEXT = &H22
Global Const KEY_END = &H23
Global Const KEY_HOME = &H24
Global Const KEY_LEFT = &H25
Global Const KEY_UP = &H26
Global Const KEY_RIGHT = &H27
Global Const KEY_DOWN = &H28
Global Const KEY_F3 = &H72
Global Const CTRL_MASK = 2
' KEY_A thru KEY_Z are the same as their ASCII equivalents: 'A' thru 'Z'
' KEY_0 thru KEY_9 are the same as their ASCII equivalents: '0' thru '9'
Global Const WM_USER = &H400
Global Const WM_GETFONT = &H31
Global Const EM_GETRECT = WM_USER + 2
Global Const EM_SETRECT = WM_USER + 3
Global Const EM_LINESCROLL = WM_USER + 6
Global Const EM_GETLINECOUNT = WM_USER + 10
Global Const EM_LINEINDEX = WM_USER + 11
Global Const EM_LINELENGTH = WM_USER + 17
Global Const EM_GETLINE = WM_USER + 20
Global Const EM_LIMITTEXT = WM_USER + 21
Global Const EM_SETTABSTOPS = WM_USER + 27
Global Const CF_SCREENFONTS = &H1&
Global Const CF_PRINTERFONTS = &H2&
Global Const CC_PREVENTFULLOPEN = &H4
Global Const SB_HORZ% = 0
Global Const SWP_NOMOVE = &H2
Global Const SWP_NOREPOSITION = &H200
Global Const SWP_NOSIZE = &H1
Global Const SWP_SHOWWINDOW = &H40
Global Const DONT_REPOS = SWP_NOMOVE Or SWP_NOREPOSITION Or SWP_NOSIZE Or SWP_SHOWWINDOW
Global TooBig As Integer
Global EOFflag As Integer
Global BoxLines As Integer
Global ScrollEvent As Integer
Global UserCancel As Integer
Global SwitchMode As Integer
Global FixedLines() As Long
Global MaxRowsInEditBox As Integer
Global HeightOfRow As Integer
Global BytesRead As Long
Global NumArrays As Single
Global Active As Integer
Global TotalLines As Long
Global Filenum As Integer
Global FileLength As Long
Global Virtual As Integer
Global InitialLoad As Integer
Global Const ToTop% = -10000
Global Const ToBottom% = 10000
Global CommandLine As Integer
Global Const MODAL = 1
Global NL As String
Global FullFilePath As String
Global FindStr As String
Global Holdv As Long
Global Holdh As Integer
Global MenuSelect As Integer
Global GoToLineNumber As Integer
Global CaseSensitiveFlag As Integer
Global FromTopFlag As Integer
Type FixedLength1
FixedLengthTemp As String * MaxBytesToRead
End Type
Type FixedLength2
FixedLengthTempHex As String * MaxBytesToReadHex
End Type
Global FL() As FixedLength1 ' For Text
Global FH() As FixedLength2
Global Handle As Integer
Global NameOfFile As String * 129
Global TotFiles As Integer
Global AveCharWidth As Integer
Global LongestLine As Single
Global ManyBytes As String
Global Hexline As Single
Global HexAddress As String * 8
Global String48 As String * 48
Global String16 As String * 16
Global Hex77 As String * 77
Global BigHexBuffer As String * 30800
Global OldScaleWidth As Integer
Global OldScaleHeight As Integer
Global optPrinterFont As String
Global optPrinterFontSize As Double
Global optPrinterFontBold As Integer
Global optPrinterFontItalic As Integer
Global Const MB_OK = 0
Global Const MB_YESNO = 4
Global Const MB_ICONSTOP = 16
Global Const MB_ICONEXCLAMATION = 48
Global Const MB_DEFBUTTON2 = 256
Global Const IDYES = 6
Global Const IDNO = 7 ' Define other.
' TextMsgs program example
Type RECT
left As Integer
top As Integer
right As Integer
bottom As Integer
End Type
Type TEXTMETRIC
tmHeight As Integer
tmAscent As Integer
tmDescent As Integer
tmInternalLeading As Integer
tmExternalLeading As Integer
tmAveCharWidth As Integer
tmMaxCharWidth As Integer
tmWeight As Integer
tmItalic As String * 1
tmUnderlined As String * 1
tmStruckOut As String * 1
tmFirstChar As String * 1
tmLastChar As String * 1
tmDefaultChar As String * 1
tmBreakChar As String * 1
tmPitchAndFamily As String * 1
tmCharSet As String * 1
tmOverhang As Integer
tmDigitizedAspectX As Integer
tmDigitizedAspectY As Integer
End Type
Declare Function GetTextMetrics% Lib "GDI" (ByVal hDC%, lpMetrics As TEXTMETRIC)
' Drag and Drop
Type POINTAPI
x As Integer
y As Integer
End Type
Type Msg
hwnd As Integer
message As Integer
wparam As Integer
lParam As Long
time As Long
pt As POINTAPI
End Type
Global NewMessage As Msg
'dragacceptfiles tells windows that hwnd can accept drag/drop messages
Declare Sub DragAcceptFiles Lib "Shell" (ByVal hwnd As Integer, ByVal Accept As Integer)
'Main() uses peekmessage to determine if hwnd has received a d/d message
Declare Function PeekMessage Lib "User" (lpMsg As Msg, ByVal hwnd As Integer, ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer, ByVal wRemoveMsg As Integer) As Integer
'dragqueryfile is used to get number of files dropped (when indexFilenum=-1) and then name of each file in succession (when indexFilenum > -1)
Declare Function DragQueryFile Lib "Shell" (ByVal hdrop As Integer, ByVal indexFilenum As Integer, ByVal lpFileName As String, ByVal buffsize As Integer) As Integer
'dragfinish must be called after all filenames have been retrieved to cancel memory buffer for d/d operation
Declare Sub DragFinish Lib "Shell" (ByVal hwnd As Integer)